package com.xpqh.ksg.modular.caseInfo.controller;

import com.xpqh.ksg.base.BaseController;
import com.xpqh.ksg.base.BaseResponseDTO;
import com.xpqh.ksg.modular.caseInfo.dto.KsgCaseDetailsReqDTO;
import com.xpqh.ksg.modular.caseInfo.service.CaseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping(value = "ksg")
public class KsgCaseDetailsController extends BaseController {

    @Autowired
    private CaseInfoService caseInfoService;

    @PostMapping("/caseDetails")
    public BaseResponseDTO details(@Valid @RequestBody KsgCaseDetailsReqDTO req) {
        return renderResultOk(caseInfoService.getCaseDetails(req.getCaseId()));
    }
}
